package com.sunriz.motordrive.controller.photovoltaic;

import com.sunriz.motordrive.domain.DTO.Result;
import com.sunriz.motordrive.server.photoVoltaic.LogInfoServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * ClassName: LogInfoController
 * Package: com.sunriz.motordrive.controller.photovoltaic.hc
 * Description:
 *  历史数据
 * @Author BuTang
 * @Create 2024/9/2 10:26
 * @Version 1.0
 */
@Slf4j
@RestController
@RequestMapping("/photoVoltaic/log")
public class LogInfoController {

    @Autowired
    LogInfoServer logInfoServer;

    @GetMapping("getDeviceIdList")
    public Result getDeviceIdList(){
        return logInfoServer.logInfoServer();
    }

    @GetMapping("/getLog")
    public Result getLog(@RequestParam("start_time") String startTime, @RequestParam("end_time") String endTime, @RequestParam("device_id") List<Integer>  deviceId , @RequestParam("info_name") String infoName){
        Result result = logInfoServer.getLog(startTime,endTime,deviceId,infoName);
        return result;
    }

    @GetMapping("/getNames")
    public Result getNames(){
        return logInfoServer.getNames();
    }
}
